<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"> 

    <h:head> 

        <title>Autentica&ccedil;&atilde;o</title>
        
        <h:outputStylesheet library="css" name="default.css"/>

    </h:head>

    <f:view encoding="ISO-8859-1" >

        <h:body style="background-image: url(resources/imagens/fndJBS_.jpg)">

            <p:growl id="messages" 
                     showDetail="true" />
            
            <div style="margin: 3%" >

                <h:panelGrid columns="2" width="100%">

                    <h:panelGroup>

                        <div align="left" >

                            <p:graphicImage url="resources/imagens/logo380.png"/>

                        </div>

                    </h:panelGroup>

                    <h:panelGroup>

                        <div align="right">

                        </div>

                    </h:panelGroup>

                </h:panelGrid>

            </div>

            <h:form>

                <p:dialog modal="true" 
                          widgetVar="statusDialog" 
                          header="Aguarde..." 
                          appendTo="@(body)"
                          draggable="false" 
                          closable="false" 
                          resizable="false">

                    <p:graphicImage value="resources/imagens/carregando.gif" />

                </p:dialog>

                <div align="center" style="margin: 2%">

                    <p:panel style="width: 300px" 
                             header="Acesso">

                        <br/>

                        <p:fieldset>

                            <h:panelGrid id="display"
                                         style="border: 0; width: 100%" >

                                <h:panelGroup>

                                    Login:<br/>
                                    <p:inputText value="#{acessoBean.usuario.login}" 
                                                 required="true" 
                                                 requiredMessage="Campo Login vazio"
                                                 style="width: 100%; text-transform: uppercase"/>

                                </h:panelGroup>

                                <h:panelGroup>

                                    Senha: <br/>
                                    <p:password  value="#{acessoBean.usuario.senha}" 
                                                 required="true" 
                                                 requiredMessage="Campo Senha vazio" 
                                                 feedback="false" 
                                                 styleClass="up" 
                                                 style="width: 100%; text-transform: uppercase"/>

                                </h:panelGroup>

                            </h:panelGrid>

                            <br/>
                            
                            <p:commandButton value="entrar" 
                                             action="#{acessoBean.doLogin()}" 
                                             onclick="statusDialog.show();" 
                                             oncomplete="statusDialog.hide()" 
                                             update=":messages"
                                             ajax="false"
                                             />

                        </p:fieldset>

                        <br/>

                    </p:panel>

                </div>

            </h:form>

        </h:body>

    </f:view>

</html>

